#!/bin/sh
# preinst script
#
# see: dh_installdeb(1)

#set -e

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
fi

case "$1" in
    install|upgrade)
	if [ ! -L $BASEDIR/usr/bin/pkill ]; then
	rm -f $BASEDIR/var/lib/dpkg/info/sunwcs.prerm
	rm -f $BASEDIR/usr/bin/bg
	rm -f $BASEDIR/usr/bin/cd
#	rm -f $BASEDIR/usr/bin/cmp
	rm -f $BASEDIR/usr/bin/command
	rm -f $BASEDIR/usr/bin/dispgid
	rm -f $BASEDIR/usr/bin/dispuid
	rm -f $BASEDIR/usr/bin/encrypt
	rm -f $BASEDIR/usr/bin/fc
	rm -f $BASEDIR/usr/bin/fg
	rm -f $BASEDIR/usr/bin/getopts
	rm -f $BASEDIR/usr/bin/hash
	rm -f $BASEDIR/usr/bin/jobs
	rm -f $BASEDIR/usr/bin/mac
	rm -f $BASEDIR/usr/bin/pfbash
	rm -f $BASEDIR/usr/bin/pfcsh
	rm -f $BASEDIR/usr/bin/pfdash
	rm -f $BASEDIR/usr/bin/pfksh
	rm -f $BASEDIR/usr/bin/pfksh93
	rm -f $BASEDIR/usr/bin/pfrksh
	rm -f $BASEDIR/usr/bin/pfrksh93
	rm -f $BASEDIR/usr/bin/pfsh
	rm -f $BASEDIR/usr/bin/pftcsh
	rm -f $BASEDIR/usr/bin/pfzsh
	rm -f $BASEDIR/usr/bin/pkill
	rm -f $BASEDIR/usr/bin/prctl
	rm -f $BASEDIR/usr/bin/print
	rm -f $BASEDIR/usr/bin/read
	rm -f $BASEDIR/usr/bin/rev
#	rm -f $BASEDIR/usr/bin/setuname
	rm -f $BASEDIR/usr/bin/type
	rm -f $BASEDIR/usr/bin/ulimit
	rm -f $BASEDIR/usr/bin/umask
	rm -f $BASEDIR/usr/bin/unalias
	rm -f $BASEDIR/usr/bin/wait
	rm -f $BASEDIR/usr/lib/fs/hsfs/fstyp
	rm -f $BASEDIR/usr/lib/fs/ufs/dcopy
	rm -f $BASEDIR/usr/lib/fs/ufs/fstyp
	rm -f $BASEDIR/usr/lib/fs/ufs/quotaon
	rm -f $BASEDIR/usr/lib/inet/in.iked
	rm -f $BASEDIR/usr/sadm/bin/dispgid
	rm -f $BASEDIR/usr/sadm/bin/dispuid
	rm -f $BASEDIR/usr/sadm/bin/errange
	rm -f $BASEDIR/usr/sadm/bin/errdate
	rm -f $BASEDIR/usr/sadm/bin/errgid
	rm -f $BASEDIR/usr/sadm/bin/errint
	rm -f $BASEDIR/usr/sadm/bin/erritem
	rm -f $BASEDIR/usr/sadm/bin/errpath
	rm -f $BASEDIR/usr/sadm/bin/errstr
	rm -f $BASEDIR/usr/sadm/bin/errtime
	rm -f $BASEDIR/usr/sadm/bin/erruid
	rm -f $BASEDIR/usr/sadm/bin/erryorn
	rm -f $BASEDIR/usr/sadm/bin/helpdate
	rm -f $BASEDIR/usr/sadm/bin/helpgid
	rm -f $BASEDIR/usr/sadm/bin/helpint
	rm -f $BASEDIR/usr/sadm/bin/helpitem
	rm -f $BASEDIR/usr/sadm/bin/helppath
	rm -f $BASEDIR/usr/sadm/bin/helprange
	rm -f $BASEDIR/usr/sadm/bin/helpstr
	rm -f $BASEDIR/usr/sadm/bin/helptime
	rm -f $BASEDIR/usr/sadm/bin/helpuid
	rm -f $BASEDIR/usr/sadm/bin/helpyorn
	rm -f $BASEDIR/usr/sadm/bin/valdate
	rm -f $BASEDIR/usr/sadm/bin/valgid
	rm -f $BASEDIR/usr/sadm/bin/valint
	rm -f $BASEDIR/usr/sadm/bin/valpath
	rm -f $BASEDIR/usr/sadm/bin/valrange
	rm -f $BASEDIR/usr/sadm/bin/valstr
	rm -f $BASEDIR/usr/sadm/bin/valtime
	rm -f $BASEDIR/usr/sadm/bin/valuid
	rm -f $BASEDIR/usr/sadm/bin/valyorn
	rm -f $BASEDIR/usr/sbin/consadmd
	rm -f $BASEDIR/usr/sbin/deallocate
	rm -f $BASEDIR/usr/sbin/dfshares
	rm -f $BASEDIR/usr/sbin/list_devices
	rm -f $BASEDIR/usr/sbin/mkdevmaps
	rm -f $BASEDIR/usr/sbin/roleadd
	rm -f $BASEDIR/usr/sbin/roledel
	rm -f $BASEDIR/usr/sbin/rolemod
	rm -f $BASEDIR/usr/sbin/share
	rm -f $BASEDIR/usr/sbin/unshare
#
	rm -f $BASEDIR/usr/sbin/prtdiag
	fi
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0
